<template>
    <model ref="modelRef" title="修改" @submit="handleSubmit" />
</template>

<script setup lang='ts'>

import { ref } from 'vue';
import model from './model.vue';
import { updateUser } from '@/api/user';
import type { SysUser } from '../impl';
import { ElMessage } from 'element-plus';
const modelRef = ref();
const emit = defineEmits(['refresh']);


const show = (data: SysUser) => {
    modelRef.value.show(data);
}
const handleSubmit = (data: SysUser) => {
    updateUser(data).then(() => {
        ElMessage.success('修改成功')

        emit('refresh')
    })
}

defineExpose({
    show
})

</script>

<style></style>